package mapper;

import BO.WorkTypeAndTitleBO;
import DO.WorkDO;
import VO.WorksVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkMapper {
    void save(WorkDO workDO);

    // 根据id获取试卷标题
    @Select("select work_type, title from work where id = #{workId}")
    WorkTypeAndTitleBO getTitleById(Integer workId);

    // 根据id获取题目数据
    @Select("select * from work where id = #{workId}")
    WorkDO getByWorkId(Integer workId);

    // 根据id获取填空题数量
    @Select("select fill_empty_number from work where id = #{workId}")
    int getFillNumber(Integer workId);

    List<WorksVO> getWokesByWakeIdList(List<Integer> wakeIdList);

    @Select("select * from work where id = #{workId}")
    WorkDO getById(Integer workId);
}
